package vn.student.mylib;

import vn.student.R;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;

public class TextInputDialog implements android.content.DialogInterface.OnClickListener {
	public static void viewDialog(String title, String str, Context ctx,android.content.DialogInterface.OnClickListener onOkClickListener){
		LayoutInflater li = LayoutInflater.from(ctx); 
		View view = li.inflate(R.layout.input_text_dialog, null);
		((EditText)(view.findViewById(R.id.editTextView))).setText(str);
		AlertDialog.Builder builder = new AlertDialog.Builder(ctx); 
		builder.setTitle(title); 
		builder.setView(view); 
		  
		builder.setPositiveButton("OK", onOkClickListener); 
		builder.setNegativeButton("Cancel", new DateDateDialog()); 
		
		//get the dialog 
		AlertDialog ad = builder.create(); 
		
		ad.show(); 
	}
	@Override
	public void onClick(DialogInterface dialog, int which) {
		// TODO Auto-generated method stub
		
	}
}